package net.paoding.rose.web.impl.thread;

public class RequestPath {

	private boolean includeRequest;
	private String method;
	private String uri; // = contextPath + ctxpath
	private String ctxpath; // by servlet container
	private String pathInfo; // = modulePath + controllerPath + actionPath
	private String modulePath; //
	private String controllerPathInfo; //
	private String controllerPath;
	private String actionPath;
	
	public void setIncludeRequest(boolean includeRequest) {
		this.includeRequest = includeRequest;
	}
	
	public boolean isIncludeRequest() {
		return includeRequest;
	}
	
	public String getMethod() {
		return method;
	}
	
	public void setMethod(String method) {
		this.method = method;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	public String getCtxpath() {
		return ctxpath;
	}

	public void setCtxpath(String ctxpath) {
		this.ctxpath = ctxpath;
	}

	public String getPathInfo() {
		return pathInfo;
	}

	public void setPathInfo(String pathInfo) {
		this.pathInfo = pathInfo;
	}

	public String getModulePath() {
		return modulePath;
	}

	public void setModulePath(String modulePath) {
		this.modulePath = modulePath;
	}
	
	public String getControllerPathInfo() {
		if (controllerPathInfo == null) {
			controllerPathInfo = pathInfo.substring(modulePath.length());
		}
		return controllerPathInfo;
	}

	public String getControllerPath() {
		return controllerPath;
	}

	public void setControllerPath(String controllerPath) {
		this.controllerPath = controllerPath;
	}

	public String getActionPath() {
		return actionPath;
	}

	public void setActionPath(String actionPath) {
		this.actionPath = actionPath;
	}
	
	@Override
	public String toString() {
		return "ctxpath=" + ctxpath + "; pathInfo=" + pathInfo + "; modulePath=" + modulePath
				+ "; controllerPath=" + controllerPath + "; actionPath=" + actionPath;
	}

}
